vcComponent

Object type for a component and its associated root node.

See in: Overview

Module: vcCore

Parent: vcNode

Children -

Referenced by: vcAuthorContext.ActiveComponent, vcBehavior.Component, vcComponentCreator.TemplateComponent, vcComponentCreator.create(), ... (see more)
vcAuthorContext.ActiveComponent
vcBehavior.Component
vcComponentCreator.TemplateComponent
vcComponentCreator.create()
vcComponentSignal.Value
vcContainer.Components
vcCore.getComponent()
vcGetPropertyStatement.SelectedComponent
vcNode.Component
vcNode.getChildComponents()
vcOneToManyInterface.ConnectedComponents
vcProduct.Component
vcProductFilter.Component
vcPropertyConditionStatement.SelectedComponent
vcRunRobotRoutineStatement.RobotComponent
vcSendSignalStatement.SelectedComponent
vcSimInterface.ConnectedComponent
vcWaitSignalStatement.Component
vcWorld.Components
vcWorld.createComponent()
vcWorld.findComponent()

Properties

Learn how to use properties here. The properties are also inherited from the parent class.

NameTypeAccessDescription
BOMBooleanRWGets or sets a value which defines whether component is included in the bill of materials.
BOMdescriptionStringRWGets or sets the component's description in the bill of materials.
BOMnameStringRWGets or sets the component's name in the bill of materials.
BackfaceModevcBackfaceModeRWGets or sets the mode for rendering geometry backfaces of component. That is, geometry not facing active camera.
CategoryStringRWGets or sets the component group in Cell Graph.
ContainervcFlowRGets the container which is storing the component.
CreationTimeRealRWGets or sets the component's creation time.
IsDynamicBooleanRGets the value indicating whether the component has been created during simulation
IsUniqueBooleanRGets the value indicating whether the component is sharing its feature trees with other components.
Jointslist[vcLinkJoint]RGets all link joints within this component, regardless of which link they are associated with.
LockedBooleanRWGets or sets a value which defines if the component is locked from being edited or manipulated in 3D world.
MaterialvcMaterialRWGets or sets the material of the component
See more
and any of its features which do not have an assigned material or whose node is set to inherit a material.
MovementOriginvcMatrixRWGets or sets the component's offset when moving on a path.
NameStringRWGets or sets component name.

Exceptions:
ValueError: When given component name is empty or not unique.
PDFExportLevelvcPdfExportLevelRWGets or sets the level of detail when exporting the component to a 3D PDF.
PackFoldervcPackFolderRGets the mechanism for attaching files to the component.
PathAccelerationRealRWGets or sets the acceleration of the component when moving on a path
PathDecelerationRealRWGets or sets the deceleration of the component when moving on a path.
PathVelocityRealRWGets or sets the velocity of the component when moving on and in the direction of a path.
ProductvcProductRGets the Process Modeling product instance linked to this component, if any.
PropertiesvcPropertyContainerRGets the properties of this component.
SimulationLevelvcSimulationLevelRWGets or sets the simulation level of the component.
UriStringRGets the component's URI.
VCIDStringRGets the VCID of component. That is, the unique key identifier of the component.
VisibleBooleanRWGets or sets the visibility of the component in 3D world.

Methods

Learn how to use methods here. The methods are also inherited from the parent class.

NameReturn TypeParametersDescription
clonevcComponentOptional Keyword[shared = Boolean]Creates a clone of the component.
See more
Parameters:
shared (Boolean): If True, the feature tree is shared between the original and cloned component. This improves performance during simulation, but the cloned components cannot be edited separately (changing the appearance of either the clone or original component affects the other).

Exceptions:
RuntimeError: When cloning of a component is not allowed. This can occur if 1) the component is not attached to World. 2) there is a hierarchy lock in the node tree, which happens during layout loading, or if the component is being moved from one place to another in the node tree. 3) attempting to call the method from the main level of the script.

Returns:
vcComponent: Newly created clone of the component.
getPathDistanceRealNoneGets the distance of component on a path. If the component is not on a path, returns negative value.

Returns:
Real: Component's distance on a path.
incrementRevisionNoneNoneIncrements the revision number of a file when using save() method.
See more
The effect is the same as the Increment Revision property in the Credits dialog when saving a file.
makeUniqueNoneNoneMakes the component's feature tree unique, thereby it's not shared with other components.
saveNoneString uriSaves the component to the given file.

Parameters:
uri (String): File path where the component is saved to.
saveStateNoneNoneSaves the current state of the component as its initial state.
startMovementNoneNoneStart the movement of component in a flow, for example a path.

Exceptions:
RuntimeError: When component is not stored in a container.
stopMovementNoneNoneStops the movement of component in a flow, for example a path.

Exceptions:
RuntimeError: When component is not stored in a container.
transferNonevcConnector connectorTransfers component into a flow and blocks Python execution until completion of transfer.
See more
Parameters:
connector (vcConnector): Connector for performing the transfer.

Exceptions:
RuntimeError: When the call cannot consume simulation time.
transferNonevcFlow flow,
Optional Keyword[port = Integer]
Transfers component into a flow and blocks Python execution until completion of transfer.
See more
Parameters:
flow (vcFlow): The flow behavior to get the connector from.
port (Integer): The port in the flow behavior to get the connector from.

Exceptions:
ValueError: When there is no valid connector at the given port.
RuntimeError: When the call cannot consume simulation time.
transferNonBlockingNonevcConnector connectorTransfers component into a flow without blocking Python execution (does not wait for completion of transfer).
See more
Parameters:
connector (vcConnector): Connector for performing the transfer.

Exceptions:
RuntimeError: When the call cannot consume simulation time.
transferNonBlockingNonevcFlow flow,
Optional Keyword[port = Integer]
Transfers component into a flow without blocking Python execution (does not wait for completion of transfer).
See more
Parameters:
flow (vcFlow): The flow behavior to get the connector from.
port (Integer): The port in the flow behavior to get the connector from.

Exceptions:
ValueError: When there is no valid connector at the given port.
RuntimeError: When the call cannot consume simulation time.

Events

Learn how to use events here. The events are also inherited from the parent class.

NameParametersDescription
OnContainerTransitionvcContainer container,
Boolean arrived
Triggered when component enters or exits a container object.
See more
Parameters:
container (vcContainer): Container through which the component transitions.
arrived (Boolean): True - component is entering the container. False - component is exiting the container.
OnNodeConfigurationChangevcNodeSynchronizationType type,
vcNode node1,
vcNode node2
Triggered when a change occurs in component node hierarchy.
See more
Parameters:
type (vcNodeSynchronizationType): type of change that occurred in component.
node1 (vcNode): First node affected by the change.
node2 (vcNode): Second node affected by the change.

Example: Conveyor Stopping One Product

""" This example shows how to stop, delay and start a product movement on a conveyor when a signal is received. """

import vcCore as vc

comp = vc.getComponent()
sensor_signal = comp.findBehavior("SensorSignal") # can be triggered by the path sensor behavior
component_signal = comp.findBehavior("ComponentSignal") # can be triggered by the path sensor behavior
process_time = comp.Properties["ProcessTime"]

async def OnRun():
  
  while True:
    await sensor_signal.waitFor(True, waitTrigger=True)
    product = component_signal.Value
    product.stopMovement() # this stops the product movement on the conveyor
    await vc.delay(process_time.Value)
    product.startMovement() # this starts the product movement on the conveyor

Example: Create New Behavior

""" This example shows how to create a new behavior. """

import vcCore as vc
import vcBehaviors as vc_beh

comp = vc.getComponent()
sensor_signal = comp.createBehavior(vc_beh.vcBehaviorType.BOOLEAN_SIGNAL, "SensorSignal")